/*----------------------------------------------------------------------------------------------------------*/
/*                                                                                                          */
/* Copyright by Huang Ying Xin                                                          */
/* All rights reserved.                                                                                     */
/*                                                                                                          */
/*------------------------------------------------------------------------------------------------------------
  File Name        : tsc2007.h
  Version          : V0.1
  Date[mm/dd/yyyy] : 06/11/2016
  Description      : The header file of tsc2007.c module.
------------------------------------------------------------------------------------------------------------*/
/* Define to prevent recursive inclusion -------------------------------------------------------------------*/
#ifndef __TSC2007_H
#define __TSC2007_H

#include "stdint.h"

/* Includes ------------------------------------------------------------------------------------------------*/

/* Exported types ------------------------------------------------------------------------------------------*/
/* Private define ------------------------------------------------------------------------------------------*/
//typedef enum {
//    I2C_START = 0,
//    I2C_SEND_ADDRESS,
//    I2C_RESTART,
//    I2C_TRANSMIT_DATA,
//    I2C_RELOAD,
//    I2C_STOP,
//    I2C_END
//} i2c_process_enum;

//#define I2C_TIME_OUT   (uint32_t)(50000)
//#define EEP_FIRST_PAGE 0x00
//#define I2C_OK         0
//#define I2C_FAIL       1

#define TSC2007_8_bit             0x02
#define TSC2007_12_bit		        0x00

#define Measure_X_Select          0xC0
#define Measure_Y_Select          0xD0
#define Measure_Z1_Select         0xE0
#define Measure_Z2_Select         0xF0

#define Converter_Mode            TSC2007_8_bit
/* Exported constants --------------------------------------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------------------------------------*/
void tsc2007_Init(void);
uint16_t tsc2007_MeasureXpos(void);
uint16_t tsc2007_MeasureYpos(void);
uint16_t tsc2007_MeasureZ1pos(void);
uint16_t tsc2007_MeasureZ2pos(void);
uint8_t  tsc2007_TS_DetectTouch(void);

#endif /* __TSC2007_H ---------------------------------------------------------------------------------*/
